package com.gitee.wsl.platform.thread

import kotlinx.cinterop.UnsafeNumber
import platform.posix._SC_NPROCESSORS_ONLN
import platform.posix.sysconf
import kotlin.math.max

@OptIn(UnsafeNumber::class)
actual val threadCount: Int
    get() = max(2, sysconf(_SC_NPROCESSORS_ONLN).toInt())